/**.
 *
 */
package com.ww.companyCabinetSystem.dao.impl;

import java.util.List;

import org.springframework.stereotype.Component;

import com.ww.companyCabinetSystem.dao.ICanvassbusinessDao;
import com.ww.companyCabinetSystem.model.bo.MCanvassbusinessBo;
import com.ww.companyCabinetSystem.utils.BeanUtils;
import com.ww.keyIdAutomaticGeneration.factory.KeyIdGenerationFactory;

/**
 * . com.ww.companyCabinetSystem.dao.impl TODO
 * 
 * @author veloster 下午12:56:30
 */
@Component("canvassbusiness")
public class CanvassbusinessDaoImpl extends BaseDaoImpl implements ICanvassbusinessDao {

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.ww.companyCabinetSystem.dao.ICanvassbusinessDao#insertCanvassbusiness
	 * (com.ww.companyCabinetSystem.model.bo.MCanvassbusinessBo)
	 */
	@Override
	public boolean insertCanvassbusiness(MCanvassbusinessBo bo) {
		String keyId = KeyIdGenerationFactory.createKeyId();
		bo.setKeyId(keyId);
		BeanUtils.notNull(bo);
		return this.sqlSession.insert("com.ww.companyCabinetSystem.dao.ICanvassbusinessDao.insertCanvassbusiness",
				bo) > 0;

	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.ww.companyCabinetSystem.dao.ICanvassbusinessDao#updateCanvassbusiness
	 * (com.ww.companyCabinetSystem.model.bo.MCanvassbusinessBo)
	 */
	@Override
	public boolean updateCanvassbusiness(MCanvassbusinessBo bo) {
		return this.sqlSession.update("com.ww.companyCabinetSystem.dao.ICanvassbusinessDao.updateCanvassbusiness",
				bo) > 0;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.ww.companyCabinetSystem.dao.ICanvassbusinessDao#selectByConfitions(
	 * com.ww.companyCabinetSystem.model.bo.MCanvassbusinessBo)
	 */
	@Override
	public List<MCanvassbusinessBo> selectByConfitions(MCanvassbusinessBo bo) {
		// TODO Auto-generated method stub
		return this.sqlSession.selectList("com.ww.companyCabinetSystem.dao.ICanvassbusinessDao.selectCanvassbusiness", bo);
	}

}
